import axiosInstance from '@/request/axios-config'

// 获取当前登录用户信息
export const currentUserService = () => {
    return axiosInstance.get('/user/currentUser') 
}

// 分页带条件查询所有user
export const pageListService = (param: any) => {
   return axiosInstance.post('/user/pageList', param)
}

// 新增用户
export const addUserService = (data: any) => {
   return axiosInstance.post('/user/add', data)
}
// 获取用户信息和roleIds
export const getUserAndRoleIds = (userId: any) => {
    return axiosInstance.get('/user/getUserAndIdsById', {
        params: {id: userId}
    })
}

// 修改用户信息
export const updateUserService = (data: any) => {
    return axiosInstance.put('/user/edit', data)
}

// 根据id获取用户信息
export const getUserById = (userId: any) => {
    return axiosInstance.get('/user/getUserById/' + userId)
}

// 删除用户
export const deleteUserByIds = (userIds: any) => {
    return axiosInstance.post('/user/delete', userIds)
}

//获取所有用户列表
export const getAllUser = () => {
    return axiosInstance.get('/user/getAllUserList')
}

// 修改密码
export const restPassService = (data: any) => {
    return axiosInstance.post('/user/resetPass', data)
}


// 修改用户状态
export const updateUserStatusById = (data: any) => {
    return axiosInstance.put('/user/updateStatus', data)
}